package models;

import java.util.*;
import javax.persistence.*;
import java.sql.Date;

import play.Logger;
import play.db.ebean.*;
import play.data.format.*;
import play.data.validation.*;

/**
 * User entity managed by Ebean
 */
@Entity
@Table(name="House")
public class House extends Model {

    @Id
    public int id;

    public int row1;
    public int row2;
    public int row3;
    public int col1;
    public int col2;
    public int col3;

    @ManyToMany
    public List<MovieSession> sessions = new ArrayList<MovieSession>();

    @OneToMany(cascade=CascadeType.ALL)
    public List<UnavailableSeat> seats = new ArrayList<UnavailableSeat>();

    // -- Queries
    public static Model.Finder<Integer,House> find = new Model.Finder(Integer.class, House.class);

	public static House findById(int id){
		return find.where().eq("id",id).findUnique();
	}


}

